<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8" />
    <title></title>
    <style type="text/css">
        *{
            margin: 0;
            padding: 0;
        }
    </style>
</head>
<body style="background: url('img/54-131025104507[1].jpg');background-size: contain">
<?php
$conn = @mysqli_connect("localhost","root","","abcd");
if (!$conn){
    die("连接数据库失败：" . mysqli_error());
}
@mysql_query("set names 'UTF8'");
//mysql_query('DELETE FROM `bbtliuyanban` WHERE `id` = \'' . $_GET['id'] . '\'');
session_start();
$a=@$_GET['id'];
$delete="delete from message WHERE id=$a";
$deleteTwo="delete from huifu WHERE id=$a";
mysqli_query($conn,$delete);
mysqli_query($conn,$deleteTwo);

$he=@$_GET['he'];
$set="update message set sheji=1 where id=$he";
mysqli_query($conn,$set);

$kq=@$_GET['kq'];
$set="update message set sheji=0 where id=$kq";
mysqli_query($conn,$set);
@session_start();
$user =@$_SESSION['username'];
$sqlT=mysqli_query($conn,"select * from user WHERE username='$user'");
$rowT=mysqli_fetch_array($sqlT);
if(!$user)
{
    echo "<script language='JavaScript'>location.href='page.php';alert('您还没有登录');</script>";
    exit();
}
?>
<div style="width: 100%;height:60px;clear: both">
    <p style="color: blue"><b>请可以上传或者更改您的头像</b></p>
</div>
<div style="width: 350px;float: left;">

    <div style="position: relative;">
        <div style="position: absolute;top: 140px"><?php include_once ('upPic.php')?></div>
        <div style="background-color: aquamarine;width: 120px;height: 120px;border-radius: 60px;text-align: center;overflow: hidden">
            <img src="<?php echo "img/wodetouxiang".$rowT['uid'].".jpg"?>" width="100" height="100" id="picOne"/>
        </div>
    </div>
</div>

<div style="width: 735px;float: left;min-height: 700px;">

    <p style="text-align: center;height: 55px;line-height: 55px;background-color: #ffcbbc;">我的主题帖</p>
    <div>
        <table width="735">
            <tr>
                <td width="115" align="center" height="80"  bgcolor="#E0EEE0">题目</td>
                <td width="510" align="center"  bgcolor="#E0EEE0">内容</td>
                <td width="35" bgcolor="#e7f4af">删除</td>
                <td width="35" bgcolor="#e7f4af">管理</td>
                <td width="35" bgcolor="#e7f4af">开启</td>
            </tr>
            <?php
            $conn = mysqli_connect("localhost","root","","abcd");
            if (!$conn){
                die("连接数据库失败：" . mysqli_error());
            }
            header("Content-type:text/html;charset=utf-8");
            $sql=mysqli_query($conn,"select * from message WHERE user='$user'");
            while ($row=mysqli_fetch_array($sql)) {
                ?>
                <tr>
                    <td bgcolor="#E0EEE0" height="80"><div align="center">
                            <?php echo $row['title']?>
                        </div></td>
                    <td bgcolor="#E0EEE"><div align="center">
                            <?php echo $row['content']?>
                        </div></td>
                    <td bgcolor="#e7f4af"><a href="personal.php?id=<?php echo $row['id']; ?>">删除</td>
                    <td bgcolor="#e7f4af"><a href="personal.php?he=<?php echo $row['id']; ?>">关闭</td>
                    <td bgcolor="#e7f4af"><a href="personal.php?kq=<?php echo $row['id']; ?>">重新<br/>开启</td>
                </tr>
                <?php
            }?>
        </table>

    </div>
    <div style="width: 100%;height:60px;clear: both">
    </div>
</div>

<?php

if($rowT['cengji']==1) {
    ?>
    <div style="position: absolute;right: 0;top:100px;width: 110px;height: 110px;border-radius: 40px;background-color: #AED98F;
text-align: center;margin: 0 auto;line-height: 110px;">
        <p><a href="guanli.php">管理</a></p>
    </div>
    <?php
}?>
</body>
</html>
